package o;

import android.util.Pair;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.extractor.mp3.Mp3Extractor.e;
import com.google.android.exoplayer2.metadata.id3.MlltFrame;
import o.aea.a;

public final class aeo implements e {
    private final long[] ˊ;
    private final long ˎ;
    private final long[] ॱ;

    public static aeo ˋ(long j, MlltFrame mlltFrame) {
        long j2 = 0;
        int length = mlltFrame.ˊ.length;
        long[] jArr = new long[(length + 1)];
        long[] jArr2 = new long[(length + 1)];
        jArr[0] = j;
        jArr2[0] = 0;
        for (int i = 1; i <= length; i++) {
            j += (long) (mlltFrame.ˋ + mlltFrame.ˊ[i - 1]);
            j2 += (long) (mlltFrame.ॱ + mlltFrame.ˎ[i - 1]);
            jArr[i] = j;
            jArr2[i] = j2;
        }
        return new aeo(jArr, jArr2);
    }

    private aeo(long[] jArr, long[] jArr2) {
        this.ॱ = jArr;
        this.ˊ = jArr2;
        this.ˎ = C.ˏ(jArr2[jArr2.length - 1]);
    }

    public boolean ˊ() {
        return true;
    }

    public a ˏ(long j) {
        Pair ˋ = ˋ(C.ˋ(anr.ˎ(j, 0, this.ˎ)), this.ˊ, this.ॱ);
        return new a(new aeh(C.ˏ(((Long) ˋ.first).longValue()), ((Long) ˋ.second).longValue()));
    }

    public long ˋ(long j) {
        return C.ˏ(((Long) ˋ(j, this.ॱ, this.ˊ).second).longValue());
    }

    public long g_() {
        return this.ˎ;
    }

    private static Pair<Long, Long> ˋ(long j, long[] jArr, long[] jArr2) {
        int ˊ = anr.ˊ(jArr, j, true, true);
        long j2 = jArr[ˊ];
        long j3 = jArr2[ˊ];
        ˊ++;
        if (ˊ == jArr.length) {
            return Pair.create(Long.valueOf(j2), Long.valueOf(j3));
        }
        long j4 = jArr[ˊ];
        return Pair.create(Long.valueOf(j), Long.valueOf(((long) ((j4 == j2 ? 0.0d : (((double) j) - ((double) j2)) / ((double) (j4 - j2))) * ((double) (jArr2[ˊ] - j3)))) + j3));
    }

    public long ˎ() {
        return -1;
    }
}
